// vue3中创建store实例对象的方法createStore()按需引入
import { createStore } from 'vuex'

export default createStore({
    state: {
        events: [],
        stopFn: null
    },
    mutations: {
        // 定义mutations，用于修改状态(同步)
        updateEvents(state, event) {
            state.events.push(event.event)
        },
        removeEvents(state, event) {
            state.events = event.event
            console.log(state.events, '9090')
        },
        updateStopFn(state, fn) {
            state.stopFn = fn.fn
            console.log(state.stopFn, '090')
        }
    },
    actions: {
    },
    getters: {
    },
    modules: {
    }
})

